import { FindUserFriendRes } from "@/modules/common/page";
import { AddUserFriendParams, AddUserFriendRes } from "@/modules/chat/index";
import request from "@/api/http";
/**
 * 查找用户
 * @param {string} page
 * @param {string} pageSize
 * @param {string} search
 * @returns
 */
export function findUserFriend(
  page: number,
  pageSize: number,
  search: string
): Promise<FindUserFriendRes> {
  return request.get(
    `/lris/user/find?page=${page}&pageSize=${pageSize}&search=${search}`
  );
}

/**
 * 添加好友
 * @param {object} params AddUserFriendDto
 * @param {number} params.addFromId 添加者id
 * @param {string} params.addNickname 添加者昵称
 * @param {object} params.addTime 添加时间
 * @param {string} params.headImg 添加者头像
 * @param {string} params.msgType 添加的方式: 100 搜索添加
 * @param {string} params.remark 添加时的备注消息
 * @param {number} params.toId 被添加者的ID
 * @returns
 */
export function AddUserFriend(
  params: AddUserFriendParams
): Promise<AddUserFriendRes> {
  return request.post(`/lris/Friend/addFriend`, params);
}
